#define   _CRT_SECURE_NO_WARNINGS  1
#pragma warning(disable:6031)
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
typedef struct ListNode ListNode;
struct ListNode* reverseList(struct ListNode* head) {
    if (head == NULL || head->next == NULL)
        return head;
    ListNode* n1 = NULL;
    ListNode* n2 = head;
    ListNode* n3 = head->next;
    while (n2)
    {
        n2->next = n1;
        n1 = n2;
        n2 = n3;
        if (n3)
            n3 = n3->next;
    }
    return n1;
}
struct ListNode* removeElements(struct ListNode* head, int val) {
    ListNode* first = head;
    ListNode* num = head;
    int i = 0;
    while (first)
    {
        if (first->val != val)
        {
            num = first;
            if (i == 0)
            {
                ++i;
                head = num;
            }
        }
        else
        {
            ListNode* first_1 = first;
            num->next = first_1->next;
        }
        first = first->next;
    }
    if (i == 0)
        return NULL;
    else
        return head;
}
struct ListNode* middleNode(struct ListNode* head) {
    ListNode* slow = head;
    ListNode* fast = head;
    while (fast && fast->next)
    {
        slow = slow->next;
        fast = fast->next->next;
    }
    return slow;
}
int main()
{

     return 0;
}
